<template>
  <div>
    <div class="banner" @click="handleGallaryClick">
      <img class="banner-img" :src="bannerImg" />
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div class="banner-number">
          <span class="iconfont icon-font">&#xe64b;</span>
          {{this.gallaryImgs.length}}
        </div>
      </div>
    </div>
    <fade>
      <common-gallary :imgs="gallaryImgs" v-show="gallaryShow" @close="handleGallaryClose"></common-gallary>
    </fade>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import Fade from 'common/fade/Fade'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      gallaryShow: false,
      imgs: []
    }
  },
  methods: {
    handleGallaryClick () {
      this.gallaryShow = true
    },
    handleGallaryClose () {
      this.gallaryShow = false
    }
  },
  components: {
    CommonGallary,
    Fade
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    position: relative
    overflow: hidden
    height: 0
    padding-bottom: 55%
    .banner-img
      width: 100%
    .banner-info
      display: flex
      position: absolute
      left: 0
      right: 0
      bottom: 0
      color: #FFFFFF
      line-height: .8rem
      background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .8))
      .banner-title
        flex: 1
        font-size: .36rem
        padding: 0 .2rem
      .banner-number
        height: .4rem
        line-height: .4rem
        margin-top: .22rem
        margin-right: .2rem
        font-size: .24rem
        background: rgba(0, 0, 0, .6)
        border-radius: .2rem
        padding: 0 .4rem
        .icon-font
          font-size: .24rem
</style>
